package com.gt.quality.system.controller;


import cn.hutool.core.collection.CollUtil;
import com.gt.quality.base.BaseCommonController;
import com.gt.quality.base.BaseCommonService;
import com.gt.quality.base.pojo.BaseLimitResponse;
import com.gt.quality.system.entity.SysFileInfo;
import com.gt.quality.system.service.SysFileInfoService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * (SysFileInfo)表控制层
 *
 * @author makejava
 * @since 2026-12-25 10:45:29
 */
@RestController
@RequestMapping("sysFileInfo")
@Tag(name = "文件管理")
public class SysFileInfoController extends BaseCommonController<SysFileInfo> {


    @Override
    protected Object extendAfterByQueryLimit(BaseLimitResponse<SysFileInfo> data) {
        List<SysFileInfo> responseBody = data.getResponseBody();
        if (CollUtil.isNotEmpty(responseBody)) {
            for (SysFileInfo sysFileInfo : responseBody) {
                sysFileInfo.setId(sysFileInfo.getFileId().toString());
            }
            data.setResponseBody(responseBody);
        }
        return super.extendAfterByQueryLimit(data);
    }

    /**
     * 服务对象
     */
    private SysFileInfoService sysFileInfoService;

    @Autowired
    public void setSysFileInfoService(SysFileInfoService service) {
        this.sysFileInfoService = service;
    }

    @Override
    public BaseCommonService<SysFileInfo> getThisService() {
        return sysFileInfoService;
    }

    @Override
    protected boolean isSuperExcel() {
        return false;
    }
}
